package com.yexiong.server.dao.impl;

import java.util.List;

import com.common.entity.Payment;
import com.yexiong.dao.IPayDao;
import com.yexiong.dao.impl.PayDaoImpl;
import com.yexiong.server.dao.IPayServer;

import utils.Page;

public class PayServerImpl implements IPayServer{
	private IPayDao IPayDao=new PayDaoImpl();
	@Override
	public int insert(Payment payment) {
		int result=0;
		result=IPayDao.insert(payment);
		return result;
	}
	@Override
	public int delete(String data) {
		int result=0;
		result=IPayDao.deleteByDocumentId(data);
		return result;
	}
	@Override
	public Page<Payment> getPage(String condition, int currentPage, int pageSize, String startTime, String endTime) {
		int count=IPayDao.getCount(startTime,endTime,condition);
		List<Payment> list=IPayDao.getOnePageInfo(condition, currentPage, pageSize,startTime,endTime);
		return new Page<>(currentPage, count, pageSize, list);
	}
	@Override
	public int update(Payment payment) {
		return IPayDao.update(payment);
	}

}
